<template>
	<view class="data-center">
		<view class="bg-box">
			<view class="count-box">
				<view>
					<text class="near">近七天内</text>
					<view class="box-content">
						<view class="count-house">
							<text style="font-weight: 700;">{{dataCenter.rooms? dataCenter.rooms: "暂无"}}</text>
							<text>订房数</text>
						</view>
						<view class="count-pople">
							<text  style="font-weight: 700;">{{dataCenter.checkIns? dataCenter.checkIns: '暂无'}}</text>
							<text>入住数</text>
						</view>
						<view class="count-total">
							<text  style="font-weight: 700;">{{dataCenter.orders ? dataCenter.orders : '暂无'}}</text>
							<text>订单数</text>
						</view>
					</view>
				</view>
			</view>
			<view class="second-content">
				<view style="color: rgb(48, 85, 200);margin: 66px 143px;">暂无数据~</view>
				<!-- <span style="margin: 0px 140px;color:#3055C8 ;">暂无数据~</span> -->
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getData
	} from '@/api/datacenter.js'
	export default {
		data() {
			return {
				dataCenter: [] //数据中心
			}
		},
    onShow() {
      this.getData()
    },
		// onLoad() {
		// 	this.getData()
		// },
		methods: {
			// 获取数据
			getData() {
				let prams = {
					endTime: '', //结束时间
					startTime: '', //开始时间
					statisticsType: 1 //类型
				}
				getData(prams).then(res => {
					if(res.code==200){
						this.dataCenter = res.data.statistics
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.data-center {
		background-color: #797979;

		.bg-box {
			position: relative;
			display: flex;
			flex-direction: column;
			align-items: center;
			width: 100%;
			height: 500rpx;
			padding: 0 20rpx;
			// background: linear-gradient(180deg, #0743AD, #f7f7f7);
			background: linear-gradient(to top, #f7f7f7, #3055C8);

			.title {
				margin-top: -70rpx;
				color: #fff;
				margin-bottom: 20rpx;
				text-align: center;
			}

			.second-content {
				width: 95%;
				height: 300rpx;
				position: absolute;
				top: 320rpx;
				border-radius: 20rpx;
				background-color: #fff;
			}

			.count-box {
				position: absolute;
				padding: 20rpx;
				top: 80rpx;
				width: 95%;
				height: 200rpx;
				color: #07288B;
				line-height: 40rpx;
				background-color: #fff;
				border-radius: 20rpx;

				.near {
					color: #07288B;
				}

				.box-content {
					display: flex;
					justify-content: space-between;
					align-items: center;
					text-align: center;
					margin-top: 10rpx;
				}

				.time,
				.count-house,
				.count-pople,
				.count-total {
					display: flex;
					flex-direction: column;
				}
			}
		}
	}
</style>